/**
 * 菜单相关请求模块
 */

import request from '@/utils/request'

export const createOrUpdateMenu = (data: any) => {
  return request({
    method: 'POST',
    url: '/front/ad/saveOrUpdate',
    data
  })
}

export const createOrUpdateAdvertSpace = (data: any) => {
  return request({
    method: 'POST',
    url: '/front/ad/space/saveOrUpdate',
    data
  })
}

export const getEditMenuInfo = () => {
  return request({
    method: 'GET',
    url: '/front/ad/space/getAllSpaces'
  })
}

export const getAllAdvert = () => {
  return request({
    method: 'GET',
    url: '/front/ad/getAdList'
  })
}

export const changeState = (params: any) => {
  return request({
    method: 'GET',
    url: '/front/ad/updateStatus',
    params
  })
}

export const getAdvertInfo = (params: any) => {
  return request({
    method: 'GET',
    url: '/front/ad/getAdById',
    params
  })
}

export const getAdvertSpaceInfo = (params: any) => {
  return request({
    method: 'GET',
    url: '/front/ad/space/getSpaceById',
    params
  })
}
